<%@page import="java.io.File"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%
	String img=request.getParameter("img"); 
	System.out.println(img);
	/* File file=new File("img\\"+img); */
	File file=new File(new File(application.getRealPath(request.getRequestURI().substring(request.getContextPath().length()))).getParent()+"\\img\\"+img);
	System.out.println(file.getAbsolutePath());
	boolean isExist=file.exists();
	
	System.out.println(isExist);
	String title;
	if(isExist)
		title=img;
	else
		title="none";
%>

<title>${title} </title>
</head>
<body>
 <%if(isExist){%>
	 <img alt="" src="img/<%=img %>">
<% }else{%>
	<p>no image</p>
<% } %>
</body>
</html>